package io.github.talelin.latticy.dto.receving;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.github.talelin.latticy.common.enumeration.DistanceUnitEnum;
import io.github.talelin.latticy.common.enumeration.InboundOrderBoxModelEnum;
import io.github.talelin.latticy.common.enumeration.MassUnitEnum;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import javax.validation.constraints.PositiveOrZero;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @authoer:wulongbo
 * @createDate:2022/7/19
 * @description:
 */
@Data
public class ReceivingPackageDTO {

    /**
     * recodeId
     */
    private Integer id;

    /**
     * 箱号
     */
    @NotBlank(message = "{packages-no.id.not-empty}")
    private String packageNo;

    /**
     * 箱子型号(1.大 2.中 3.小 4.特大)
     */
    @NotNull(message = "{packages.boxModel.not-empty}")
    @Positive
    private InboundOrderBoxModelEnum boxModel;

    /**
     * 尺寸单位类型
     */
    @NotNull(message = "{packages.distanceUnit.not-empty}")
    private DistanceUnitEnum distanceUnit;

    /**
     * 重量单位类型
     */
    @NotNull(message = "{packages.massUnit.not-empty}")
    private MassUnitEnum massUnit;

    /**
     * 单箱重量
     */
    private BigDecimal weight;

    /**
     * 长
     */
    @NotNull(message = "{packages.length.not-empty}")
    private BigDecimal length;

    /**
     * 宽
     */
    @NotNull(message = "{packages.height.not-empty}")
    private BigDecimal height;

    /**
     * 高
     */
    @NotNull(message = "{packages.width.not-empty}")
    private BigDecimal width;

    /**
     * 本次接收件数
     */
    private Integer receiveNum;

    /**
     * 单次接收的标品总数
     */
    @Positive
    @NotNull(message = "{packages.specimen.not-empty}")
    private Integer specimen;

    /**
     * 单次接收的破损总数
     */
    @PositiveOrZero
    @NotNull(message = "{packages.damaged.not-empty}")
    private Integer damaged;

    /**
     * 揽收时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime receivedTime;

    @Valid
    private List<ReceivingSkuDTO> skus;

}
